var app = getApp();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    member: {},
    mainInfo: {},
    pageno: 0,
    applied: [],
  },
  doSign: function () {
    var _this=this;
    app.doReq(app.globalData.SERVICE.USERCENTER.CHECKIN, {
      id: app.globalData.userid
    }, 'GET', function (res) {
      if (res.data.code == 200 && res.data.type === 'SUCCESS') {
        wx.showToast({
          title: '签到成功！',
          icon: 'success'
        });
        app.getUserInfo({"openId":wx.getStorageSync('openid')});
        _this.initPage(0);
      }
    });
  },
  onLoad: function (options) {
    wx: wx.setNavigationBarTitle({
      title: '每日签到',
    });
    var isPartId = options.id;
    this.initPage(isPartId);
  },
  initPage: function (isPartId) {//初始化页面数据
    var _this = this;
    app.getUserInfo({"openId":wx.getStorageSync('openid')});
    _this.setData({
      member: wx.getStorageSync('userInfo')
    })

    app.doReq(app.globalData.SERVICE.USERCENTER.LOAD_CHECKIN, {
      id: app.globalData.userid
    }, 'GET', function (res) {
      _this.setData({
        increase: res.data.obj.configNum
      });
    });
  }
})